import requests
import json


headers = {
    "Accept": "application/json, text/plain, */*",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Content-Type": "application/json",
    "Origin": "https://moc.oocl.com",
    "Pragma": "no-cache",
    "Referer": "https://moc.oocl.com/nj_prs_wss/",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-origin",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36",
    "sec-ch-ua": "\"Google Chrome\";v=\"129\", \"Not=A?Brand\";v=\"8\", \"Chromium\";v=\"129\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\""
}
cookies = {
    "_uab_collina": "172689897867376914385098",
    "cscaptachaCookie": "d016911e-be56-4514-8de8-8921ccfc23cf",
    "userSearchHistory": "%5B%7B%22origin%22%3A%22Shanghai%2C%20China%22%2C%22destination%22%3A%22Los%20Angeles%2C%20Los%20Angeles%2C%20California%2C%20United%20States%22%2C%22originId%22%3A461802935876374%2C%22destinationId%22%3A461802935877065%2C%22originCityTimeZone%22%3A%22Asia%2FShanghai%22%2C%22originCountryCode%22%3A%22CN%22%2C%22destinationCountryCode%22%3A%22US%22%2C%22transhipment_PortId%22%3Anull%2C%22transhipment_Port%22%3Anull%2C%22service%22%3Anull%2C%22port_of_LoadId%22%3Anull%2C%22port_of_Load%22%3Anull%2C%22port_of_DischargeId%22%3Anull%2C%22port_of_Discharge%22%3Anull%2C%22origin_Haulage%22%3A%22cy%22%2C%22destination_Haulage%22%3A%22cy%22%2C%22cargo_Nature%22%3A%22dry%22%2C%22sailing%22%3A%22sailing.from%22%2C%22weeks%22%3A%222%22%7D%2C%7B%22origin%22%3A%22Shanghai%2C%20China%22%2C%22destination%22%3A%22Long%20Beach%2C%20Los%20Angeles%2C%20California%2C%20United%20States%22%2C%22originId%22%3A461802935876374%2C%22destinationId%22%3A461802935877067%2C%22originCityTimeZone%22%3A%22Asia%2FShanghai%22%2C%22destinationCityTimeZone%22%3A%22America%2FLos_Angeles%22%2C%22originCountryCode%22%3A%22CN%22%2C%22destinationCountryCode%22%3A%22US%22%2C%22transhipment_PortId%22%3Anull%2C%22transhipment_Port%22%3Anull%2C%22service%22%3Anull%2C%22port_of_LoadId%22%3Anull%2C%22port_of_Load%22%3Anull%2C%22port_of_DischargeId%22%3Anull%2C%22port_of_Discharge%22%3Anull%2C%22origin_Haulage%22%3A%22cy%22%2C%22destination_Haulage%22%3A%22cy%22%2C%22cargo_Nature%22%3A%22dry%22%2C%22sailing%22%3A%22sailing.from%22%2C%22weeks%22%3A%222%22%7D%5D",
    "BIGipServeriris4-wss": "1613880978.61451.0000",
    "BIGipServerpool_ir4moc": "590470802.20480.0000",
    "BIGipServerpool_moc_8011": "2022663115.19231.0000",
    "AcceptCookie": "yes",
    "AcceptCookie_Functional": "yes",
    "AcceptCookie_Statistical": "yes"
}
url = "https://moc.oocl.com/nj_prs_wss/mocss/secured/supportData/nsso/searchHubToHubRoute"
data = {
    "date": "2024-11-16",
    "displayDate": "2024-11-16",
    "transhipment_Port": None,
    "port_of_Load": None,
    "port_of_Discharge": None,
    "sailing": "sailing.from",
    "weeks": "2",
    "transhipment_PortId": None,
    "service": None,
    "port_of_LoadId": None,
    "port_of_DischargeId": None,
    "origin_Haulage": "cy",
    "destination_Haulage": "cy",
    "cargo_Nature": "dry",
    "originId": 461802935876374,
    "originCountryCode": "CN",
    "destinationCountryCode": "US",
    "originCityTimeZone": "Asia/Shanghai",
    "destinationCityTimeZone": "America/Los_Angeles",
    "destinationId": 461802935877067,
    "origin": "Shanghai, China",
    "destination": "Long Beach, Los Angeles, California, United States",
    "showCaptcha": "false",
    "csToken": "RLdT4Pa2qo++OfKS8DH6aEFadk2OTd2g+aD4/nIi2DmcG3MO8IzxJBz7qFnh25lu",
    "appKey": "1dc597b617744cb49c97e20b523931e1",
    "weeksSymbol": "+"
}
data = json.dumps(data, separators=(',', ':'))
response = requests.post(url, headers=headers, cookies=cookies, data=data)

print(response.text)
print(response)